	window.http={v:'0.0.3','auth':'sykbxc','content':'ajax网络请求'};
	//post 请求
	http.post=function(url,data,success,error,complete){
		requset('post',url,data,success,error,complete,"application/json","json");
	};
	//get请求
	http.get=function(url,success,error,complete){
		requset('get',url,'',success,error,complete,"application/json","json");
	};
    http.input={};
	http.input.pwd=function (val) {
		var myreg=/^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,20}$/;
        if (!myreg.test(val)) {return false;} else {return true;}
    }
    http.input.mobile=function (val) {
        var myreg=/^1[34578]\d{9}$/;
        if (!myreg.test(val)) {return false;} else {return true;}
    }
    http.urlParam = function (name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
    }

	//requset请求
	function requset(method,url,data,success,error,complete,contentType,dataType){
        var load = layer.load();
		var requestData={
				url  : url,
				type : method,
				data : data,
				// contentType : contentType,
				// dataType : dataType,
				success : function(result) {
					if(typeof success === 'function'){
						if(!result.success){
							layer.msg(result.message, {icon: 5});
						 }else{
							success(result);  
						 }
					}else{
						layer.msg( '回调成功函数传入错误!');
					}
				},
				error : function(e) {
					if(typeof error === 'function'){
						error(e);
					}else{
						layer.msg( '服务端请求错误!');
					}
				},
				complete:function(e){
                    layer.close(load);
					if(typeof complete === 'function'){
						complete(e);
					}
				}
			};
		
		if(method==='get'){
			delete requestData["data"];
		}
		$.ajax(requestData);
	};
